package com.ccys.cms.controller.userManagement;

import com.ccys.cms.service.userManagement.TblMemberAllergiesWebService;
import com.ccys.common.constants.ContextConstants;
import com.ccys.common.util.Kit;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.userManagement.TblMemberAllergiesDTO;
import com.ccys.db.entity.TblMemberAllergies;
import com.ccys.db.vo.userManagement.TblMemberAllergiesWebVO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@Api(tags = "用户管理-allergies")
@RequestMapping("userManagement")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE, RequestMethod.PUT}) // 开启跨域访问允许
@SuppressWarnings("unchecked")
public class MemberAllergiesWebController {

    @Autowired
    private TblMemberAllergiesWebService tblMemberAllergiesWebService;

    @GetMapping("memberAllergies")
    @ApiOperation("查询用户过敏信息列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "memId", value = "病人用户ID", required = false, dataType = "string", paramType = "query"),

    })
    @ApiResponses({
            @ApiResponse(code = 411, message = ContextConstants.DESC_411),
            @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = TblMemberAllergiesWebVO.class)
    })
    public ResponseResult listObjectsCms(HttpServletRequest request, HttpServletResponse response, @ApiIgnore TblMemberAllergiesDTO dto) {
        return this.tblMemberAllergiesWebService.listObjectsCms(request, response, dto);
    }



}